Virtual memory is a technique that allows processes that may not be entirely in the memory to execute by means of automatic storage allocation upon request. The term virtual memory refers to the abstraction of separating logical memory from physical memory. The logical memory is the memory as seen by the process. The physical memory is the actual location of the memory as seen by the processor. Many times the physical memory is not in main memory of the processor but is actually in a secondary source of memory, such as a disk drive or an array of disk drives. As a result of this separation, the operating system maintains two or more levels of physical memory space. The virtual memory abstraction is implemented by using secondary storage to augment the processor's main memory. Data is transferred from secondary to main storage when necessary. The data is replaced and written back to the secondary storage according to a predetermined replacement algorithm.
Data can be of fixed or variable size. A unit of fixed sized storage is many times designated as a page of storage. When the data swapped is a designated, fixed size, the swapping is called paging. Buffer memory is a part of a main memory on a processor. The data, instructions, and variables needed to perform a process are written into the buffer of the main memory so the processor can use the data, values or instructions to perform a request. Pages of variables, instructions or data can be written into buffer memory. Pages of variables, instructions or data can be read from buffer memory and stored in secondary memory.
One of the items buffer memory stores is return addresses for main memory. Hackers can attack a process and a processor by overwriting the buffer memory and specifically overwriting the return address for main. If the return address is overwritten, the process will discontinue. If the return address is overwritten with another address, such as the address for the buffer, the hacker can take over the process with instructions input by the hacker. If the program is a privileged program, the instructions will be allowed to do most anything, including taking over the machine. There is a need for a method and apparatus for preventing such attacks to the main memory of a machine. More specifically, there is a need for a method and apparatus for preventing such attacks to the buffer portion of the main memory to prevent a machine from being taken over.